package com.scau.ums.service.imp.suggest;

import com.scau.ums.mapper.MaintainerMapper;
import com.scau.ums.mapper.SuggestionMapper;
import com.scau.ums.model.Suggestion;
import com.scau.ums.model.SuggestionExample;
import com.scau.ums.service.CommonSuggest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author: 莫伟杰
 * date： 2019/7/23 15:16
 */
@Service
public class MaintainerSuggestImp implements CommonSuggest {

    private MaintainerMapper maintainerMapper;
    public SuggestionMapper suggestionMapper;

    @Autowired
    public MaintainerSuggestImp(MaintainerMapper maintainerMapper, SuggestionMapper suggestionMapper) {
        this.maintainerMapper = maintainerMapper;
        this.suggestionMapper = suggestionMapper;
    }

    @Override
    public List<Suggestion> getAllSuggestions() {
        SuggestionExample example = new SuggestionExample();
        example.createCriteria().andStateEqualTo(STATE_PASS);
        return suggestionMapper.selectByExample(example);
    }//获取所有通过审核的言论

    @Override
    public List<Suggestion> getUserSuggestions(String userID) {
        return null;
    }

    @Override
    public List<Suggestion> getLatestSuggestions(int startIndex, int pageSize) {
        return null;
    }

    @Override
    public boolean newSuggestions(String userID, String suggestionStr) {
        return false;
    }

    @Override
    public boolean delSuggestion(Suggestion s) {
        return false;
    }
}
